<!--
 * @Author: your name
 * @Date: 2021-05-25 08:47:11
 * @LastEditTime: 2021-05-25 08:57:45
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \xd-cesium-vue\src\components\Draw.vue
-->
<template>
    <menu-bar :todoList="list">
        <template v-slot:item0>
            <span @click="drawPoint" class="menuButton">绘制点</span>
        </template>
        <template v-slot:item1>
            <span @click="drawLine" class="menuButton">绘制线</span>
        </template>
        <template v-slot:item2>
            <span @click="drawPolygon" class="menuButton">绘制面</span>
        </template>
    </menu-bar>
</template>
<script>
import MenuBar from '@/components/MenuBar'
import PointDraw from '@/assets/js/cesium/PointDraw'
import PolygonDraw from '@/assets/js/cesium/PolygonDraw'
import PolylineDraw from '@/assets/js/cesium/PolylineDraw'

    export default{
        components:{MenuBar},
        data(){
            return{
                list:["点","线","面"]
            }
        },
        methods:{
            drawPoint(){
                let pointDraw =new PointDraw(global.viewer,global.eventUtil);
                pointDraw.start();
                // let draw =new Draw(global.viewer, global.eventUtil);
                // draw.start()
            },
            drawLine(){
                let polylineDraw =new PolylineDraw(global.viewer,global.eventUtil);
                polylineDraw.start();

            },
            drawPolygon(){
                let polygonDraw =new PolygonDraw(global.viewer,global.eventUtil);
                polygonDraw.start();
            },
            
        }
    }
</script>